<?
    require_once("config.php");
    
    switch ($_GET['action']) {
        case "get_concerto_feed_name":
            $server = urldecode($_GET['server']);            
            if ($server[strlen($server)-1] != '/') $server .= '/'; // make sure there's a trailing /
            
            $feedid = $_GET['id'];
            
            $data = file_get_contents($server . "?type=rss&format=rss&select_id=$feedid");
            $matches = array();
            
            preg_match("/description>((\w|\s)+)/",$data,$matches);
            $feedname = $matches[1];
            
            echo ($feedname ? $feedname : "Unknown Feed: $feedid");
        break;
        default: "unknown action: $_GET[action]";
    }
?>